import request from '@/utils/request'

// 查询房屋信息列表
export function listHouse(query) {
  return request({
    url: '/entity/house/list',
    method: 'get',
    params: query
  })
}

// 查询房屋信息详细
export function getHouse(houseId) {
  return request({
    url: '/entity/house/' + houseId,
    method: 'get'
  })
}

// 新增房屋信息
export function addHouse(data) {
  return request({
    url: '/entity/house',
    method: 'post',
    data: data
  })
}

//新增预约看房信息
export function addHouseAppointment(data) {
  return request({
    url: '/domain/appointment',
    method: 'post',
    data: data
  })
}

// 修改房屋信息
export function updateHouse(data) {
  return request({
    url: '/entity/house',
    method: 'put',
    data: data
  })
}

// 删除房屋信息
export function delHouse(houseId) {
  return request({
    url: '/entity/house/' + houseId,
    method: 'delete'
  })
}

// 用户申请租房
export function userContractApp(houseId) {
  return request({
    url: '/domain/contract/AppContract/' + houseId,
    method: 'post'
  })
}

//查看房屋发布人信息
export function mediumUserDetail(houseId) {
  return request({
    url: '/domain/medium/' + houseId,
    method: 'get'
  })
}

//中介上传房屋产权证
export function uploadEstate(data) {
  return request({
    url: '/entity/house/upload/estate',
    method: 'post',
    data: data
  })
}

//管理员审核后正式发布房源
export function adminReleaseHouse(data) {
  return request({
    url: '/entity/house/release',
    method: 'post',
    data: data
  })
}

//上传房源图片
export function uploadHouseImg(data){
  return request({
    url:'/entity/house/uploadHouseImg',
    method: 'post',
    data: data
  })
}
